#用程序设计一个猜拳游戏
import random

print("欢饮进入猜拳游戏！请输入你要出的选项：石头、剪刀、布")
player = input("请输入：")
computer_list = ["石头", "剪刀", "布"]
computer = random.choice(computer_list)
if player not in computer_list:
    print("请重新输入!")
print("玩家: %s 电脑: %s" % (player, computer))
if (player == "石头" and computer == "剪刀") \
        or (player == "剪刀" and computer == "布") \
        or (player == "布" and computer == "石头"):
    print("恭喜你，玩家胜利！！！")
elif player == computer:
    print("平局")
else:
    print("电脑胜利")


# 一个学校，三个办公室，八位老师，随机分配办公室
import random
school = [[], [], []]
teacher_list = [1, 2, 3, 4, 5, 6, 7, 8]
for i in teacher_list:
    school_office = random.randint(0,2)
    school[school_office].append(i)
print(school)


# 1 python基础
# 1.1 str = 'a,hello'在字符串中查找hello
str = 'a,hello'
print(str.index("hello"))

# 1.2 str = 'a,b,c,d'用逗号分割str字符串，并保存到列表
str = 'a,b,c,d'
print(str.split(","))

# 1.3 将"笔试题123A"中 123替换为“进行中”
str = "笔试题123A"
print(str.replace("123","进行中"))


# 用任意变成语言循环输出数字0到10
num = 0
while num <= 10:
    print(num)
    num += 1

# 用任意语言实现逆序输出一个字符串，比如【欢乐逛欢迎您】，输出【您迎欢逛乐欢】。
str1 = ["欢","乐","逛","欢","迎","您"]
str1.reverse()
print(str1)
